package cn.edu.tju.elm.controller.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;

import java.math.BigDecimal;

/**
 * 银行卡绑定DTO
 */
public class BankCardBindDto {

    @NotBlank(message = "银行卡号不能为空")
    @Size(max = 50, message = "银行卡号长度不能超过50位")
    private String cardNumber;

    @NotNull(message = "银行卡类型不能为空")
    private Integer cardType; // 1-储蓄卡，2-信用卡

    @NotBlank(message = "银行名称不能为空")
    @Size(max = 100, message = "银行名称长度不能超过100位")
    private String bankName;

    @NotBlank(message = "持卡人姓名不能为空")
    @Size(max = 50, message = "持卡人姓名长度不能超过50位")
    private String cardholderName;

    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    private BigDecimal balance; // 储蓄卡余额

    private BigDecimal creditLimit; // 信用卡额度

    @Size(max = 500, message = "备注长度不能超过500位")
    private String remark;

    // 构造函数
    public BankCardBindDto() {}

    // Getter和Setter方法
    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public Integer getCardType() {
        return cardType;
    }

    public void setCardType(Integer cardType) {
        this.cardType = cardType;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getCardholderName() {
        return cardholderName;
    }

    public void setCardholderName(String cardholderName) {
        this.cardholderName = cardholderName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public BigDecimal getCreditLimit() {
        return creditLimit;
    }

    public void setCreditLimit(BigDecimal creditLimit) {
        this.creditLimit = creditLimit;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
